﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DigitalAnts.webUserControl
{
    public partial class WebLoginStatus : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string _role = HttpContext.Current.Session["Role"].ToString();
            if (HttpContext.Current.Session["Logged"] != null)
            {
                if (HttpContext.Current.Session["Logged"].Equals(true))
                {
                    if(_role.Equals("Admin") || _role.Equals("Mod"))
                    {
                        Response.Redirect("~/User/UserLogin.aspx");
                    }
                }    
                
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
        }

    }
}